package com.feri.gb.controller;

import com.feri.gb.entity.Family;
import com.feri.gb.service.intf.FamilyService;
import com.feri.gb.vo.PageBean;
import com.feri.gb.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/family/")
public class FamilyController {
    @Autowired
    private FamilyService service;
//    新增
    @PostMapping("save.do")
    public R save(Family family){
        return service.save(family);
    }
//查询
    @GetMapping("page.do")
    public PageBean page(int page,int limit){
        return service.queryPage(page,limit);
    }
}
